package com.iris.live.services.services;

import com.iris.live.services.data.models.FinanceDepositCheckModel;
import com.iris.live.services.data.models.PushApprovalWorkFlowModel;
import com.iris.live.services.data.models.SaleAdminCarResourceCheckModel;
import com.iris.live.services.data.models.报价单表Model;
import com.iris.live.services.models.PageData;
import com.iris.live.services.models.RequestBase;
import com.iris.live.services.models.ResultData;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 *
 */
public interface ApprovalService {
    ResultData importPrivilegeForCarModel(MultipartFile file, String user);

    ResultData getPrivilegeForCarModel(ApprovalService.GetPrivilegeForCarModelRequest request);

    ResultData exportPrivilegeForCarModel(ApprovalService.GetPrivilegeForCarModelRequest request);

    ResultData getPrivilegeForCarModelDealer(ApprovalService.GetPrivilegeForCarModelRequest request, String dlr);
    /**
     * @author DF
     */
    List getApprovalList(GetApprovalListRequest reqeust);

    ResultData CancelApproval(getCancalApproval re, String p, String u);

    /**
     * 添加审批流水
     */
    ResultData addApprovalWorkFlow(PushApprovalWorkFlowModel model, String userName);

    /**
     * 根据id修改审批流水
     *
     * @param
     * @return
     */
    boolean modifyApprovalWorkFlowById(List<PushApprovalWorkFlowModel> list, String current_step, String SNP, String date) throws Exception;

    /**
     * 查询订单审批list
     *
     * @param reqeust
     * @return
     */
    public PageData getOrderApprovalList(GetApprovalListRequest reqeust);

    public List getCarTypeList(GetApprovalListRequest reqeust);

    /**
     * 获取snp
     *
     * @param request
     * @return
     */
    public List getSNP(getSNPRequest request);

    List<Map> getGP(String dealer, Integer quoNum);

    /**
     * 合同审批时获取GP4.5
     */
    BigDecimal getGp4d5(Integer qNum);

    /**
     * 获取顾客重新分配
     *
     * @param sex
     * @param phone
     * @return
     */
    public Map getAssign(String sex, String phone, String permit);

    /**
     * 保存顾客重新分配的结果
     *
     * @param name
     * @return
     */
    public boolean updateAssignById(String name, String id);

    /**
     * 资源释放
     *
     * @return
     */
    public PageData getRelease(String permit, GetReleaseRequest request);

    /**
     * 保存延长资源锁定
     *
     * @param req
     * @return
     */
    public boolean updateReleaseEndDate(UpdateReleaseEndDateRequest req);

    /**
     * 释放的后续操作
     *
     * @param req
     * @return
     */
    public Map updateReleaseHandle(String username, UpdateReleaseHandle req) throws IOException, ClassNotFoundException;

    /**
     * 自动资源释放
     *
     * @param
     * @return
     */
    public boolean autoReleaseDaily();

    /**
     * 资源释放提醒
     *
     * @param
     * @return
     */
    public boolean sendReleaseNotice();

    /**
     * 重复接待仲裁
     *
     * @return
     */
    public PageData getReArbitrate(String permit, GetReArbitrate req);

    public PageData getReArbitrateTest(String permit, GetReArbitrate req);

    /**
     * 查询仲裁详情
     *
     * @param id
     * @return
     */
    public Map getReArbitrateDetail(String permit, String saleManA, String saleManB, String id);

    /**
     * 保存仲裁结果
     *
     * @param req
     * @return
     */
    public boolean updateReArbitrateDetail(UpdateReArbitrateDetail req);

    ResultData getSaleAdminCheckList(String permit, String username, GetSaleAdminCheckList getSaleAdminCheckList);

    boolean saleAdminCarResourceCheck(SaleAdminCarResourceCheckModel model);

    /**
     *
     */
    public List showCarTransferLog(String permit, String VIN);

   /* public Lsh消息Model getLshMsg(String sendPermit, String sendUser, String recPermit, String recUser, String msgType, String content,
                                String updateUser, String cellNumber);*/

    ResultData contractFlowCheck(String permit, String quotedPriceNumber);

    ResultData reviewContractApproval(ApprovalService.ReviewContractApprovalRequest req, String permit);

    ResultData reviewContractApprovalDetail(Integer id);

    ResultData FinanceDepositCheck(FinanceDepositCheckModel model);

    ResultData FinanceDepositCheckList(String permit,SetService.inOutAccountRequest re);

    /**
     * 获取合同审批人
     *
     * @param permit
     * @param quotedPriceNumber
     * @param stockId
     * @return
     */
    ResultData contractFlowCheck(String permit, String quotedPriceNumber, String stockId);

    ResultData getCurrentApprovalStatus(String quotedPriceNumber);

    void updateOldOrNewRecord(报价单表Model quotationOrderModel, int type);

    static class getCancalApproval {
        public String qid;
        public String state;
    }

    static class GetApprovalListRequest extends RequestBase {
        public String permit;//许可
        public String type;// 审批 类型
        public String quotedPriceCodeOrVIN;
        public String userName;
        public String clientName;// 顾客姓名
        public String appstatus;// 审批状态
        public String cartypes;// 车型
        public String soleman;// 销售顾问
        public String starDate;// 申请开始日期
        public String endDate;// 申请结束日期
        public String truepermit;//经销商名字
    }

    static class getSNPRequest {
        public String carCode;
        public String apperanceCode;
        public String quotedPriceCode;
    }

    static class GetReleaseRequest extends RequestBase {
        public String permit;
    }

    static class GetUpdateAssignById {
        public String id;
        public String name;
    }

    static class GetReArbitrate extends RequestBase {
        public String permit;
    }

    static class UpdateReArbitrateDetail {
        public String permit;
        public String cusName;
        public String cusTel;
        public String cusId;
        public String saleMan;  //仲裁失败销售顾问
        public String succesMan;  //仲裁归属销售顾问
    }

    static class UpdateReleaseEndDateRequest {
        public String orderId;
        public String newReleaseEndDay;
    }

    static class UpdateReleaseHandle {
        public String storeId;
    }

    static class GetSaleAdminCheckList extends RequestBase {
        public String orderSignatureDateStart;
        public String orderSignatureDateEnd;
        public String contractSignatureDateStart;
        public String contractSignatureDateEnd;
        public String scName;
        public String cusName;

    }

    class ReviewContractApprovalRequest extends RequestBase {
        public String applyStartDate;     // 过滤条件，合同提交开始时间
        public String applyEndDate;       // 过滤条件，合同提交结束时间
        public String approvedStartDate;  // 过滤条件，审批通过开始时间
        public String approvedEndDate;    // 过滤条件，审批通过结束时间
        public String scName;             // 销售顾问名
        public String invoiceUsername;    // 开票人名
        public String approvalType;       // 审批类型
    }

    class GetPrivilegeForCarModelRequest extends RequestBase {
        public String carBrand;
        public String carClass;
        public String carModel;
    }
}
